package com.mocha.bss.domain.org.convert;

import com.coffee.core.CoffeeConvert;
import com.mocha.bss.domain.org.repository.entity.AdmdivEntity;
import com.mocha.bss.org.bo.AdmdivBO;
import com.mocha.bss.org.vo.AdmdivTreeVO;
import com.mocha.bss.org.vo.AdmdivVO;
import com.pinghua.mocha.basics.dmo.AdmdivRedisBO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

/**
 * @author songkui
 * @since 2025/03/24
 */
@Mapper
public interface AdmdivConvert extends CoffeeConvert<AdmdivBO, AdmdivEntity, AdmdivVO> {
    AdmdivConvert INSTANCE = Mappers.getMapper(AdmdivConvert.class);

    AdmdivRedisBO entityToRedisBo(AdmdivEntity entity);

    default AdmdivTreeVO entityToTreeVO(AdmdivEntity entity) {
        AdmdivTreeVO admdivTreeVO = new AdmdivTreeVO();
        admdivTreeVO.setChoose(false);
        admdivTreeVO.setName(entity.getName());
        admdivTreeVO.setCode(entity.getCode());
        return admdivTreeVO;
    }

}
